package com.group9.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Arrays;
import java.util.Date;

/**
 * 一级评论实体类
 *
 * {
 *     id: 1001,
 *     senderId: 101,
 *     senderName: A,
 *     senderPic: /img/A.png,
 *     resourceId: 201,
 *     resourceName: apple,
 *     commentContent: "great",
 *     ...
 *     commentResponse:[{
 *          id:2001
 *          senderName: B,
 *          receiverName:A,
 *          commentContent:"yes",
 *
 *
 *     },
 *                      {
 *
 *     },
 *     ...
 *     ]
 *
 *
 * }
 * Created by Lcouncillor on 2020/6/5.
 */
@Document(collection = "resource_comment")
public class ResourceComment {
    /**
     * 一级评论id
     */
    @Id
    private String id;

    /**
     * 评论者id
     */
    @Field(value = "sender_id")
    private String senderId;

    /**
     * 评论者用户名
     */
    @Field(value = "sender_name")
    private String senderName;

    /**
     * 评论者头像url
     */
    @Field(value = "sender_pic")
    private String senderPic;

    /**
     * 评论对象id
     */
    @Field(value = "resource_id")
    private String resourceId;

    /**
     * 评论对象名，即水果名
     */
    @Field(value = "resource_name")
    private String resourceName;

    /**
     * 评星
     */
    @Field(value = "comment_star")
    private Integer commentStar;

    /**
     * 评论内容
     */
    @Field(value = "comment_content")
    private String commentContent;

    /**
     * 评论图片
     */
    @Field(value = "comment_pic")
    private String[] commentPic;

    /**
     * 点赞数
     */
    @Field(value = "thumb_up_amount")
    private Integer thumbUpAmount;

    /**
     * 点赞者id数组
     */
    @Field(value = "thumb_uper_id")
    private String[] thumbUperId;

    /**
     * 评论时间
     */
    @Field(value = "comment_time")
    private Date commentTime;

    /**
     * 二级评论id数组
     */
    @Field(value = "response_id")
    private String[] responseId;

    /**
     * 状态号：1表示一级评论
     */
    private Integer status = 1;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getSenderPic() {
        return senderPic;
    }

    public void setSenderPic(String senderPic) {
        this.senderPic = senderPic;
    }

    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public Integer getCommentStar() {
        return commentStar;
    }

    public void setCommentStar(Integer commentStar) {
        this.commentStar = commentStar;
    }

    public String getCommentContent() {
        return commentContent;
    }

    public void setCommentContent(String commentContent) {
        this.commentContent = commentContent;
    }

    public String[] getCommentPic() {
        return commentPic;
    }

    public void setCommentPic(String[] commentPic) {
        this.commentPic = commentPic;
    }

    public Integer getThumbUpAmount() {
        return thumbUpAmount;
    }

    public void setThumbUpAmount(Integer thumbUpAmount) {
        this.thumbUpAmount = thumbUpAmount;
    }

    public String[] getThumbUperId() {
        return thumbUperId;
    }

    public void setThumbUperId(String[] thumbUperId) {
        this.thumbUperId = thumbUperId;
    }

    public Date getCommentTime() {
        return commentTime;
    }

    public void setCommentTime(Date commentTime) {
        this.commentTime = commentTime;
    }

    public String[] getResponseId() {
        return responseId;
    }

    public void setResponseId(String[] responseId) {
        this.responseId = responseId;
    }

    public Integer getStatus() {
        return status;
    }


    @Override
    public String toString() {
        return "ResourceComment{" +
                "id='" + id + '\'' +
                ", senderId='" + senderId + '\'' +
                ", senderName='" + senderName + '\'' +
                ", senderPic='" + senderPic + '\'' +
                ", resourceId='" + resourceId + '\'' +
                ", resourceName='" + resourceName + '\'' +
                ", commentStar=" + commentStar +
                ", commentContent='" + commentContent + '\'' +
                ", commentPic=" + Arrays.toString(commentPic) +
                ", thumbUpAmount=" + thumbUpAmount +
                ", thumbUperId=" + Arrays.toString(thumbUperId) +
                ", commentTime=" + commentTime +
                ", responseId=" + Arrays.toString(responseId) +
                ", status=" + status +
                '}';
    }
}
